package controller;

import model.entities.Student;
import model.dao.ConnectionFactory;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import model.dao.StudentDAO;
import model.dao.service.StudentDAOService;


/**
 *
 * @author pc
 */
public class StudentController implements StudentDAOService {

    @Override
    public List<Student> getStudentsList() {
        return StudentDAO.getInstance().getStudentsList();
    }

    @Override
    public Student getStudentByID(int studentID) {
        return StudentDAO.getInstance().getStudentByID(studentID);
    }

    @Override
    public boolean insertStudent(Student S) {
        return StudentDAO.getInstance().insertStudent(S);
    }

    @Override
    public boolean updateStudent(Student S) {
        return StudentDAO.getInstance().updateStudent(S);
    }

    @Override
    public boolean deleteStudent(int id) {
        return StudentDAO.getInstance().deleteStudent(id);
    }

    @Override
    public List<Student> findByID(int id) {
        return StudentDAO.getInstance().findByID(id);
    }

    @Override
    public List<Student> findByName(String name) {
        return StudentDAO.getInstance().findByName(name);
    } 
}
